﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;

namespace IntelligentDecisioning.SharePoint.Definition
{
    /// <summary>
    /// Defines the structure and properties of a list item event receiver that we want to provision thorough code
    /// </summary>
    public class SharePointListItemEventHandler
    {
        public int ListId { get; set; }
        public string ListName {get; set;}
        public SPList TargetList { get; set; }
        public string AssemblyName { get; set; }
        public string ClassName { get; set; }
        public bool AllEvents { get; set; }
        public RegistrationType RegistrationType { get; set; }
        public List<SPEventReceiverType> EventReceiverTypes { get; set; }


        public SharePointListItemEventHandler()
        {
            AllEvents = true;
            EventReceiverTypes = new List<SPEventReceiverType>();
        }

        /// <summary>
        /// Checks if the assembly name has been set
        /// </summary>
        /// <returns>true if the assembly name has been explicitly set.</returns>
        public bool AssemblyNameIsSet()
        {
            return (String.IsNullOrEmpty(AssemblyName) ? false : true);
        }
    }
}
